<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
    
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <link rel="stylesheet" href="css/common.css" type="text/css" />
        <link href="css/adminstyle.css" rel="stylesheet" type="text/css">
		<link href="css/ui-lightness/jquery-ui-1.10.3.custom.min.css" rel="stylesheet" type="text/css">
		<script  language="javascript" type="text/javascript" src="js/jquery-1.9.1.min.js"></script>
		<script   language="javascript" type="text/javascript"src="js/jquery-ui-1.10.3.custom.js"></script>
		<title><?=Common::_t('page_admin_area')?></title>
</head>
<script>
$(function() {		
	$( "#tabs" ).tabs();
});
function openStudentCourseList(id,height,width){
	var url = 'bookCourse_studentCourseList.htm?user_id='+id;
	window.open (url,'newwindow','height='+height+',width='+width+',top=0,left=0,toolbar=no,menubar=no,scrollbars=no, resizable=no,location=no, status=no');
}
</script>
    <body>
    <?$page_th = Common::_t('page_th');?>
 <div id="man_zone">
		<div id="tabs">
			<ul>
				<li><a href="#tabs-2"><?=getStr($page_th, 'coureRecord_info')?></a></li>
				<li><a href="#tabs-1"><?=getStr($page_th, 'class_info')?></a></li>
		    </ul>        
            <div style="background-color:#FFFFFF ">
                <? $id=$courseRecord['id']; 
				$page_th = Common::_t('page_th');
				?>
				<div id="tabs-2">
                    <form method="post" id="form" action="">
                        <input name="id" type="hidden" value="<?=$id?>">
                        <input name="user_id" type="hidden" value="<?=$user['id']?>">
                        <input name="book_course_id" type="hidden" value="<?=$_GET['bookCourseId']?>"
                        />
                        <table width="98%" border="0" align="center" cellpadding="3" cellspacing="1" class="tableborder">
	                            <tr class="header">
	                                <td colspan="4">
	                                    &nbsp;<?=getStr($page_th, 'class_record')?>
	                                </td>
	                            </tr>
                            <tr bgcolor="#FFFFFF" >
                            <td align="right" class="left_title_2adminssd">
                                 &nbsp;<?=getStr($page_th, 'student_name')?>
                            </td>
                            <td  style="width:200px;">
                         		   <?=$book['english_name']?>                                                   
                            </td>
                            <td align="right" class="left_title_2adminssd">
                             	&nbsp;<?=getStr($page_th, 'user_kind')?>
                            </td>
                            <td>
                            	<font color="red"><?=$user_data['user_kind'][$user['user_kind']]?></font>
                            </td>
                        	</tr>                           
                            <tr bgcolor="#FFFFFF" >
                            <td align="right" class="left_title_2adminssd">
                                 &nbsp;<?=getStr($page_th, 'lesson_learned')?>
                            </td>
                            <td  style="width:200px;">
                            <br>&nbsp;&nbsp;<font color="blue"><?=$userData['sumStudyClass']?></font>&nbsp;&nbsp;classes                                                   
                            </td>
                            <td align="right" class="left_title_2adminssd">
                             	&nbsp;<?=getStr($page_th, 'class_record_list')?>
                            </td>
                            <td>
                             <input type="button" name="student_record" value="List" onClick="openStudentCourseList('<?=$book['user_id']?>','600','800');">
                            </td>
                        	</tr>                           
                            <tr bgcolor="#FFFFFF" >
                            <td align="right" class="left_title_2adminssd">
                              	<?=getStr($page_th, 'student_status')?>
                            </td>
                            <td  style="width:200px;">
                               <?=page_modifier_radios('user_status',$book['user_status_list'],$book['user_status'])?>
                            </td>
                            <td align="right" class="left_title_2adminssd">
                            &nbsp;
                            </td>
                            <td>
                             &nbsp;
                            </td>
                        </tr>
                            <tr bgcolor="#FFFFFF">
                                <td class="left_title_2adminssd">
                                    <?=getStr($page_th, 'teach_content')?>
                                </td>
                                <td>
                                    <textarea name="content" cols="80" rows="10" id="content"><?=$courseRecord['content']?></textarea>
                                </td>
                                <td class="left_title_2adminssd">
                                    <?=getStr($page_th, 'student_content')?>
                                </td>
                                <td>
                                    <textarea name="feedback" cols="80" rows="10" id="feedback"><?=$courseRecord['feedback']?></textarea>
                                </td>
                            </tr>
                            <tr bgcolor="#FFFFFF">
                                <td class="left_title_2adminssd">
                                    <?=getStr($page_th, 'grammar')?>
                                </td>
                                <td>
                                    <textarea name="grammar" cols="80" rows="4" id="grammar"><?=$courseRecord['grammar']?></textarea>
                                </td>
                                <td class="left_title_2adminssd">
                                    <?=getStr($page_th, 'vocabulary')?>
                                </td>
                                <td colspan="3">
                                    <textarea name="vocabulary" cols="80" rows="4" id="vocabulary"><?=$courseRecord['vocabulary']?></textarea>
                                </td>
                            </tr>
                            <tr bgcolor="#FFFFFF">
                                <td class="left_title_2adminssd">
                                    <?=getStr($page_th, 'pronunciation')?>
                                </td>
                                <td>
                                    <textarea name="pronunciation" cols="80" rows="4"  id="pronunciation"><?=$courseRecord['pronunciation']?></textarea>
                                </td>
                                <td class="left_title_2adminssd">
                                    <?=getStr($page_th, 'teacher_message')?>
                                </td>
                                <td colspan="3">
                                    <textarea name="teacher_message" cols="80" rows="4" id="teacher_message"><?=$courseRecord['teacher_message']?></textarea>
                                </td>
                            </tr>
                            <?if($book['book_type']==BOOK_TYPE_2){?>
                            <tr bgcolor="#FFFFFF">
                                <td  class="left_title_2adminssd">
                                   	<?=getStr($page_th, 'student_level')?>
                                </td>
                                <td>
                                  <select id="user_level" name="user_level">
                                  <option value=""><?=Common::_t('page_select');?></option>
                                	  <?=$courseRecord['userLevelOption']?>
                                  </select>  
                                </td>
                                <td>
                                    &nbsp;
                                </td>
                                <td>
                                    &nbsp;
                                </td>
                            </tr>
                            <?}?> 
                            <tr bgcolor="#FFFFFF">
                                <td colspan="4">
                                    &nbsp;
                                </td>
                            </tr>
                            <? $backUrl='BookCourse_lists.html' ; if($_SESSION[ 'admin']['teacher_id']>0){ $backUrl = 'BookCourse_teacherGetList.html'; } ?>
                                <tr bgcolor="#FFFFFF">
                                    <td colspan="4" align="center">
                                        <input name="input" type="button" class="PublicBot" value="<?=Common::_t('page_back')?>" onclick="javaScript:location.href='<?=$backUrl?>'"
                                        />
                                        <?$url='CourseRecord_subAdd.html'; if  (!empty($id)){ $url = 'CourseRecord_subUpdate.html'; }  ?>
                                        <input class="PublicBot" name="save" type="button" id="save_button" value="<?=Common::_t('page_save')?>" onClick="subs(this.id,'<?=$url?>')"/>
                                        &nbsp;&nbsp;&nbsp;
                                        <input class="PublicBot" name="complete" type="button" id="complete_button" value="<?=Common::_t('page_complete')?>" onClick="subs(this.id,'CourseRecord_subComplete.html')"/>
                                    </td>
                                </tr>
                        </table>
                    </form>
                    </div>
					<div  id="tabs-1">  
					    <table width="99%" border="0" align="center"  cellpadding="3" cellspacing="1" class="tableborder">   
					        <tr class="header">
					          <td colspan="8"><?=getStr($page_th, 'class_info')?></td>
					        </tr>
					        <tr  bgcolor="#FFFFFF">
					          <td style="font-weight:bold;width:10%;" align="center"><?=getStr($page_th, 'class_title')?></td>
					          <td style="width:20%;">
					          	<span class="span_detail"><?=getStr($page_th, 'book_type')?>：<?=$book['book_type_name']?>&nbsp;</span><br>
					          	<br>
					          	<span class="span_detail"><?=getStr($page_th, 'class_time')?>：<?=$book['book_time']?></span><br>
					          	<br>
					          	<span ><?=getStr($page_th, 'class_tool')?>：<?=$book['communication_tools_name']?></span></td>
					          <td style="font-weight:bold;" align="center"><?=getStr($page_th, 'book_status')?></td>
							  <td><?=$book['class_status_name']?></td>
					          <td style="font-weight:bold;" align="center">
					          	<?=getStr($page_th, 'teacher_status')?>
					          </td>
					          <td><?=$book['teacher_status_name']?></td>          
					          <td style="font-weight:bold;" align="center"><?=getStr($page_th, 'student_status')?></td>
					          <td><?=$book['user_status_name']?></td>
					      </tr>
					      <tr  bgcolor="#FFFFFF">
					      <td colspan="8">&nbsp;
					      
					      </td>
					      </tr>      
					        <tr  bgcolor="#FFFFFF">
					          <td style="font-weight:bold;width:10%;" align="center"><?=getStr($page_th, 'course_info')?></td>
					          <td >
					          <span class="span_detail"><?=getStr($page_th, 'course_title')?>:<?=$course['theme']?>&nbsp;</span><br>
					          <span class="span_detail"><?=getStr($page_th, 'course_no')?>:<?=$course['serial_number']?>&nbsp;</span><br>
					          </td>
					          <td style="font-weight:bold;" align="center"><?=getStr($page_th, 'course_type')?></td>
					          <td><?=$course['type_name']?></td>
					          <td style="font-weight:bold;" align="center"><?=getStr($page_th, 'chapter_info')?></td>
					          <td>
					         <?if($course['type']!=COURSE_TYPE_SPECIAL){?>
					          <span class="span_detail"><?=getStr($page_th, 'chapter_no')?>:<?=$book['chapter_no']?>&nbsp;</span><br>
					          <span class="span_detail"><?=getStr($page_th, 'chapter_title')?>:<?=getLangStr($book['chapter_name'],$_SESSION['admin']['default_lang'])?>&nbsp;</span><br>
							  <?}?>
					          </td>
					          <td style="font-weight:bold;" align="center"><?=getStr($page_th, 'course_download')?></td>
							  <td>
							  <?if($course['type']!=COURSE_TYPE_SPECIAL){?>
							  <a href="chapter_download.html?id=<?=$book['chapter_id']?>" target="_blank">
							  <font color="blue"><?=getStr($page_th, 'course_download')?></font></a>
							  <?}?>
							  </td>
					      </tr>
					      <tr  bgcolor="#FFFFFF">
					      <td colspan="8">&nbsp;
					      
					      </td>
					      </tr>
					       <tr bgcolor="#FFFFFF">
					          <td style="font-weight:bold;" align="center"><?=getStr($page_th, 'student_title')?></td>
					          <td><span  class="span_detail"><?=getStr($page_th, 'student_name')?>：<?=$book['english_name']?>
					          </span>
					          <br>
					          <?if($_SESSION['admin']['admin_type']!=ADMIN_TYPE_TEACHER){ ?>
					          <br>
					          <span  class="span_detail"><?=getStr($page_th, 'student_tel')?>：<?=$book['phone']?></span>
					          <br>
					          <?}?>
					          <br>
					          <? if($book['communication_tools']==QQ){?>
					          <span class="span_detail">QQ：<?=$book['qq']?></span>
					          <? } ?>
					          <? if($book['communication_tools']==SKYPE){?>
					          <span class="span_detail">SKYPE：<?=$book['skype_id']?></span>
					          <?}?>
					          <br>
					          <br>
					          <span class="span_detail"><?=getStr($page_th, 'student_job')?>：<?=getStr($user['user_job_pair'],$user['job'])?></span>
					          <br>
					          <br>
					          <span><?=getStr($page_th, 'student_level')?>：<?=getStr($user['level_pair'],$user['level'])?></span>
					          </td>
							  <?if($_SESSION['admin']['admin_type']!=ADMIN_TYPE_TEACHER){ ?>	
						          <td style="font-weight:bold;" align="center"><?=getStr($page_th, 'student_follower')?></td>
						          <td ><?=$user['employee_name']?></td>                    
						          <td style="font-weight:bold;" align="center"><?=getStr($page_th, 'student_message')?></td>
						          <td colspan="5"><?=$book['message']?></td>
					          <?}else{?>                    
						          <td style="font-weight:bold;" align="center"><?=getStr($page_th, 'student_message')?></td>
						          <td colspan="7"><?=$book['message']?></td>
					          <?}?>
					        </tr>
					      <tr  bgcolor="#FFFFFF">
					      <td colspan="8">&nbsp;
					      
					      </td>
					      </tr>        
					        <tr bgcolor="#FFFFFF">
					          <td style="font-weight:bold;" align="center"><?=getStr($page_th, 'teacher_title')?></td>
					          <td ><br><span  class="span_detail"><?=getStr($page_th, 'teacher_name')?>：<?=$teacher['name']?></span><br><br>
					          <? if($book['communication_tools']==QQ){?>
					          <span >QQ：<?=$teacher['qq']?></span>
					          <? } ?>
					          <? if($book['communication_tools']==SKYPE){?>
					          <span >SKYPE：<?=$teacher['skype']?></span>
					          <? }?>
					          <br>
					          <br>
					          </td>
					           <?if($_SESSION['admin']['admin_type']!=ADMIN_TYPE_TEACHER){ ?>	
						          <td style="font-weight:bold;" align="center"><?=getStr($page_th, 'teacher_follower')?></td>
						          <td ><?=$teacher['employee_name']?></td>
						          <td style="font-weight:bold;" align="center"><?=getStr($page_th, 'teacher_service')?></td>
						          <td><?=$teacher['email']?></td>
						          <td style="font-weight:bold;" align="center"><?=getStr($page_th, 'teacher_level')?></td>
						          <td><?=getStr($user['level_pair'],$teacher['teach_level'])?></td>
					          <?}else{?>          
						          <td style="font-weight:bold;" align="center">&nbsp;</td>
						          <td colspan="5"></td>
					          <?}?>
					        </tr>
					      <tr  bgcolor="#FFFFFF">
					      <td colspan="8">&nbsp;
					      
					      </td>
					      </tr>        
						</table>
						</td>
				       </tr>
					 </table>
				</div>                    
            </div>
        </div>
    </body>
<?$page_message = Common::_t('page_message');
  $int_book_time = $book['int_book_time'];
?>
<script type="text/javascript">
var time =new Object();
var now_time = '<?=time();?>';
var int_book_time ='<?=$int_book_time?>';
time.response = function(res){
	if(res.success=='success'){
		now_time=res.value;
	}
}

function subs(id,value){
	$.ajax({
		 type:'POST',
		 url:'CourseRecord_getNowTime.html',
		 data:'',
		 dataType: 'json',
		 success:time.response,
		 async:false
	});
	if(now_time<int_book_time){
		alert('<?=getStr($page_message, 'class_warn_message')?>');
		return;
	}
	
	var user_status = $("input[name='user_status']:checked").val();
	
	if(user_status==1){
		var content = $("#content").val();
		var teacher_message = $("#teacher_message").val();
		if(content.length<200){
			alert('<?=getStr($page_message, 'content_message')?>');
			return;
		}
		if(teacher_message.length<200){
			alert('<?=getStr($page_message, 'teacher_message_message')?>');
			return;
		}
	}else{
		var content = $("#content").val();
		var feedback = $("#feedback").val();
		var grammar = $("#grammar").val();
		var vocabulary = $("#vocabulary").val();
		var pronunciation = $("#pronunciation").val();
		var teacher_message = $("#teacher_message").val();
		if(content.length>0||feedback.length>0||grammar.length>0||vocabulary.length>0||pronunciation.length>0||teacher_message.length>0){
			alert('<?=getStr($page_message, 'student_status_message')?>');
			return;
		}
	
	}
	if(id=='complete_button'){
		if(confirm('<?=getStr($page_message, 'complete_record_message')?>')){
			document.getElementById('form').action=value;
			document.getElementById('form').submit();
			return;
		}
	}
	document.getElementById('form').action=value;
	document.getElementById('form').submit();
}
</script>
</html>